import React, { Component } from 'react';
import  {
	TextInput,
	View,
	Text,
	TouchableOpacity
} from 'react-native';


class Welcome extends React.Component {

	//返回上一页
	back() {
		this.props.navigator.pop();
	}

	render() {
		return (
			<View style={{ flex: 1, alignItems: 'center', backgroundColor: '#FFFFFF' }}>
				<Text>欢迎页</Text>
				<Text>上一页传递的数据是: {this.props.name}</Text>
				<Text>用户token是 :{this.props.userToken}</Text>
				<TextInput
					onChangeText={age => this.props.changeMyAge(age) }
					placeholder={'输入要返回的参数:'}
					style={{ height: 40, width: 200 }} />
				<TouchableOpacity onPress={this.back.bind(this)} >
					<Text style={{ color: '#55ACEE' }}>保存数据</Text>
				</TouchableOpacity>
			</View>
		);
	}
}
export default Welcome;